﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using Microsoft.Lync.Controls;

namespace WorkItemCollaborator
{
    public class CollaboratedWorkItem : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        public CollaboratedWorkItem()
        {
            historyItems = new ObservableCollection<HistoryItem>();
        }

        private int selectedFieldIndex;
        public int SelectedFieldIndex
        {
            get { return selectedFieldIndex; }
            set
            {
                this.selectedFieldIndex = value;
                OnPropertyChanged("SelectedFieldFilter");
            }
        }

        private int currentHistoryDisplayCount;
        public int CurrentHistoryDisplayCount
        {
            get { return currentHistoryDisplayCount; }
            set
            {
                this.currentHistoryDisplayCount = value;
                OnPropertyChanged("CurrentHistoryDisplayCount");
            }
        }

        
        private int workItemId;
        public int WorkItemId
        {
            get { return workItemId; }
            set
            {
                this.workItemId = value;
                OnPropertyChanged("WorkItemId");
            }
        }

        private string description;
        public string Description
        {
            get { return description; }
            set
            {
                this.description = value;
                OnPropertyChanged("Description");
            }
        }

        private DateTime createdOn;
        public DateTime CreatedOn
        {
            get { return createdOn; }
            set
            {
                this.createdOn = value;
                OnPropertyChanged("CreatedOn");
            }
        }

        private User createdBy;
        public User CreatedBy
        {
            get { return createdBy; }
            set
            {
                this.createdBy = value;
                OnPropertyChanged("CreatedBy");
            }
        }

        private User assignedTo;
        public User AssignedTo
        {
            get { return assignedTo; }
            set
            {
                this.assignedTo = value;
                OnPropertyChanged("AssignedTo");
            }
        }

        private string title;
        public string Title
        {
            get { return title; }
            set
            {
                this.title = value;
                OnPropertyChanged("Title");
            }
        }

        private bool isUserLoading;
        public bool IsUserLoading
        {
            get { return isUserLoading; }
            set
            {
                this.isUserLoading = value;
                OnPropertyChanged("IsUserLoading");
            }
        }
    
        private ConversationContextualInfo workItemContextualInformation;
        public ConversationContextualInfo WorkItemContextualInformation
        {
            get { return this.workItemContextualInformation; }
            set
            {
                this.workItemContextualInformation = value;
                OnPropertyChanged("WorkItemContextualInformation");
            }
        }

        private ObservableCollection<HistoryItem> historyItems;
        public ObservableCollection<HistoryItem> HistoryItems
        {
            get { return historyItems; }
            set
            {
                this.historyItems = value;
                OnPropertyChanged("Description");
            }
        }

        protected void OnPropertyChanged(string name)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(name));
            }
        }
    }
}
